import 'package:flutter_test/flutter_test.dart';
import 'package:zd_plugin/zd_plugin.dart';
import 'package:zd_plugin/zd_plugin_platform_interface.dart';
import 'package:zd_plugin/zd_plugin_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockZdPluginPlatform
    with MockPlatformInterfaceMixin
    implements ZdPluginPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final ZdPluginPlatform initialPlatform = ZdPluginPlatform.instance;

  test('$MethodChannelZdPlugin is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelZdPlugin>());
  });

  test('getPlatformVersion', () async {
    ZdPlugin zdPlugin = ZdPlugin();
    MockZdPluginPlatform fakePlatform = MockZdPluginPlatform();
    ZdPluginPlatform.instance = fakePlatform;

    expect(await zdPlugin.getPlatformVersion(), '42');
  });
}
